package api

import "fx_swift_forex/pkg/validator"

type RegisterReq struct {
	Password    string `json:"password" binding:"required"`
	Email       string `json:"email" binding:"required"`
	Code        string `json:"code" binding:"required"`
	AccountType string `json:"account_type" binding:"required"`
	Country     string `json:"country"  binding:"required"`
}

func (req RegisterReq) GetMessage() validator.ValidatorMessages {
	return validator.ValidatorMessages{
		"Password.required":    "Password不能为空",
		"Email.required":       "Email不能为空",
		"Code.required":        "Code不能为空",
		"AccountType.required": "AccountType不能为空",
		"Country.required":     "Country不能为空",
	}
}

type LoginReq struct {
	Email    string `json:"email" binding:"required"`
	Password string `json:"password" binding:"required"`
}

func (req LoginReq) GetMessage() validator.ValidatorMessages {
	return validator.ValidatorMessages{
		"Email.required":    "Email不能为空",
		"Password.required": "Password不能为空",
	}
}

type SignOutReq struct {
	Account string `json:"account" binding:"required"`
}

func (req LoginReq) SignOutReq() validator.ValidatorMessages {
	return validator.ValidatorMessages{
		"Account.required": "Account不能为空的",
	}
}

type LoginRes struct {
	Token           string `json:"token"`
	Email           string `json:"email"`
	Account         string `json:"account"`
	AgentNo         string `json:"agentNo"`
	AccountType     string `json:"account_type"`
	Country         string `json:"country"`
	CustomerId      string `json:"customer_id"`
	CustomerStatus  string `json:"customer_status"`
	ScreenResult    string `json:"screen_result"`
	DefaultCurrency string `json:"default_currency"`
}
type ForgetPasswordReq struct {
	Code        string `json:"code" binding:"required"`
	Email       string `json:"email" binding:"required"`
	NewPassword string `json:"newPassword" binding:"required"`
}

func (req ForgetPasswordReq) GetMessage() validator.ValidatorMessages {
	return validator.ValidatorMessages{
		"Code.required":        "Code不能为空",
		"Email.required":       "Email不能为空",
		"NewPassword.required": "NewPassword不能为空",
	}
}

type UpdatePasswordReq struct {
	OldPassword string `json:"old_password" binding:"required"`
	NewPassword string `json:"new_password" binding:"required"`
}

func (req UpdatePasswordReq) GetMessage() validator.ValidatorMessages {
	return validator.ValidatorMessages{
		"OldPassword.required": "OldPassword不能为空",
		"NewPassword.required": "NewPassword不能为空",
	}
}

type GetAgentInfoRes struct {
	Email           string `json:"email"`
	Account         string `json:"account"`
	AccountType     string `json:"account_type"`
	Country         string `json:"country"`
	DefaultCurrency string `json:"default_currency"`
	CustomerId      string `json:"customer_id"`
	CustomerStatus  string `json:"customer_status"`
	ScreenResult    string `json:"screen_result"`
	AgentNo         string `json:"agent_no"`
}

type RespData struct {
	ErrCode     string      `json:"error_code"`
	ErrMessages interface{} `json:"error_messages"`
}

type ComplyRespData struct {
	Errors  []string `json:"errors"`
	Message string   `json:"message"`
}

type CurrencyCloudLoginReq struct {
	LoginId string `json:"login_id"`
	ApiKey  string `json:"api_key"`
}

type CurrencyCloudLoginRes struct {
	AuthToken string `json:"auth_token"`
}
